<div class="box bo_eee pad_10">
<?php
$hybridauth = new Hybrid_Auth ( $config );
$connected_adapters_list = $hybridauth->getConnectedProviders ();
if (count ( $connected_adapters_list )) {
	?>
    <?php }else{ ?>
          <?php
}
?>
<?php
// try to get already authenticated provider list
try {
	$hybridauth = new Hybrid_Auth ( $config );
	
	$connected_adapters_list = $hybridauth->getConnectedProviders ();
	
	if (count ( $connected_adapters_list )) {
		?> 


	<div class="span12">
    	
			<?php
		foreach ( $connected_adapters_list as $adapter_id ) {
			?>
                    <!--You are login with-->
		<h2><?php echo $lang['YOUARELOGINWITH'];?> <span
			style="font-weight: bold;"><?php echo $adapter_id?></span></h2>
		<!--please select the account type!-->
		<b><?php echo $lang['PLSSELECTTHEACCOUNT'];?></b>
		<form name="buyer_registerForm" id="Form"
			action="<?php echo W_ROOT; ?>/social/check.php?provider=<?php echo $adapter_id?>&return_url=<?php echo $return_url;?>"
			method="post">
			<input type="hidden" name="account_from"
				value="<?php echo $adapter_id?>" />


			<div class="row-fluid">
				<div class="span6">
					<label class="checkbox"> <input type="radio" name="accounttype"
						value="4" class="required"/>&nbsp;<!--Buyer-->
						<?php echo $lang['MENU_BUYER']	; ?>
                    </label>
				</div>
				<div class="span6">
					<label class="checkbox"> <input type="radio" name="accounttype"
						value="2" class="required"/>&nbsp;<!--Seller-->
						<?php echo $lang['LOG_SELLER'] ;?>
                    </label>
				</div>
			</div>

			<input type="submit" class="btn"
				value="<?php echo $lang['CONTINUUE'];?>" name="btnSubmit"
				onclick="tit();" />
		</form>  
                    <?php
		}
		?>
</div>
<?php
	}
} catch ( Exception $e ) {
	echo "Ooophs, we got an error: " . $e->getMessage ();
	
	echo " Error code: " . $e->getCode ();
	
	echo "<br /><br />Please try again.";
	
	echo "<hr /><h3>Trace</h3> <pre>" . $e->getTraceAsString () . "</pre>";
}
?>
</div>

